package it.lupo.model.service;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

public class LanguageService {
	
	private Properties properties = new Properties();
	private static LanguageService instance;
	
	private LanguageService() throws FileNotFoundException, IOException
	{
		String lang = System.getProperty("lupo.lang");
		if(lang==null)
			lang="it";
		
		
		properties.load(new FileInputStream(new File("lang_"+lang+".message")));
	}
	
	public static LanguageService getDefault()
	{
		if(instance == null)
			try {
				instance = new LanguageService();
			} catch (Exception e) {
				e.printStackTrace();
			}
		return instance;
	}
	
	
}
